<HTML><HEAD><TITLE>exclude_range(?Var, ++Lo, ++Hi)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ic_kernel)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>exclude_range(?Var, ++Lo, ++Hi)</H1>
Exclude the elements Lo..Hi from the domain of Var.
<DL>
<DT><EM>Var</EM></DT>
<DD>Integer variable or integer
</DD>
<DT><EM>Lo</EM></DT>
<DD>Integer lower bound of range to exclude
</DD>
<DT><EM>Hi</EM></DT>
<DD>Integer upper bound of range to exclude
</DD>
</DL>
<H2>Description</H2>
<P>
   Primitive for excluding the integers between Lo and Hi (inclusive) from
   the domain of an integer variable.  The call may fail (when the domain of
   Var has no elements outside the range Lo..Hi), succeed (possibly updating
   the variable's domain), or instantiate the variable (in the case where
   the domain gets restricted to a singleton value).</P><P>

   Note that this predicate is intended for use only in implementing
   constraint propagators, and should not be called from ordinary user code.
   It differs from the usual constraint predicates with respect to the
   execution of delayed goals.  If the call to exclude_range/3 results in a
   domain change, any delayed goals suspended on that change will be
   scheduled for execution, as normal.  However, exclude_range/3 does not
   call the woken goal scheduler (wake/0), so these goals may not be
   executed immediately.  (It is possible that under some circumstances the
   goals will be executed, if wake/0 is called indirectly - one example
   would be by the unify handler if the variable becomes ground - but this
   should not be relied upon.)  To ensure that the goals are eventually
   executed, the caller should arrange for wake/0 to be called at some
   appropriate point in the subsequent execution.  Please see the "Advanced
   Control Features" section of the User Manual for more information about
   woken goal management.</P>

<H2>Examples</H2>
<PRE>[eclipse 3]: X :: 0..10, exclude_range(X, 4, 7).
X = X{[0 .. 3, 8 .. 10]}
Yes (0.00s cpu)

[eclipse 4]: X :: 0..10, exclude_range(X, 9, 20).
X = X{0 .. 8}
Yes (0.00s cpu)

[eclipse 5]: X :: [2, 4, 6 .. 10], exclude_range(X, 4, 12).
X = 2
Yes (0.00s cpu)
</PRE>
<H2>See Also</H2>
<A HREF="../../lib/ic_kernel/exclude-2.html">exclude / 2</A>, <A HREF="../../lib/ic_kernel/impose_min-2.html">impose_min / 2</A>, <A HREF="../../lib/ic_kernel/impose_max-2.html">impose_max / 2</A>, <A HREF="../../lib/ic_kernel/impose_domain-2.html">impose_domain / 2</A>
</BODY></HTML>
